export function downloadFile(fileName, url) {
  const a = document.createElement('a')
  const href = typeof url === 'string' ? url : window.URL.createObjectURL(url)
  a.download = fileName
  a.href = href
  document.querySelector('body').appendChild(a)
  a.click()
  a.remove()
  window.URL.revokeObjectURL(href)
}
